package com.example.finance_oa.controller;

import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.read.builder.ExcelReaderBuilder;
import com.example.comment_oa.pojos.Budget;
import com.example.comment_oa.pojos_vo.AmountVo;
import com.example.comment_oa.response.AjaxResponse;
import com.example.finance_oa.dubbo.AccountListener;
import com.example.finance_oa.service.AmountService;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@RestController
@CrossOrigin
@RequestMapping("/financeOa")
public class AmountController {
    @Autowired
    AmountService amountService;
    //查询登录人员所有的报销
    @RequestMapping("amount/allAmount")
    public AjaxResponse allamount(@RequestBody AmountVo amountVo){
        System.out.println(amountVo.getKssj());
        return AjaxResponse.success(amountService.allAmount(amountVo));

    }


    @RequestMapping("amount/sumOne/{empId}")
    public AjaxResponse sumOne(@PathVariable("empId")int empId){
        System.out.println(amountService.sumamountMoney1(empId));
        return AjaxResponse.success(amountService.sumamountMoney1(empId));
    }

    @RequestMapping("amount/sumTwo/{empId}")
    public AjaxResponse sumTwo(@PathVariable("empId")int empId){
        return AjaxResponse.success(amountService.sumamountMoney2(empId));
    }

    @RequestMapping("amount/amonutXb/{amountProcess}")
    public AjaxResponse amountXb(@PathVariable("amountProcess")String amountProcess){
        return  AjaxResponse.success(amountService.amountXb(amountProcess));

    }

}
